package com.foreknow.demo9;

public class ExcptionDemo1 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};

        try{
            for (int i = 0;i<arr.length;i++){
                System.out.println(arr[i]);
            }
            System.out.println("1");
        }catch (ArrayIndexOutOfBoundsException a){
            System.out.println("我们需要处理异常....");
        }finally {
            System.out.println("有没有异常都会输出");
        }
        System.out.println("程序继续向下执行");
    }
}
